<?php

namespace Models;

class Alipay extends BaseModel {

    public function initialize()
    {
        $this->hasMany("appid", "Models\AlipayImg", "appid", array('alias' => 'AlipayImg'));

//        $this->belongsTo("token", "WxText", "token");
//        $this->belongsTo("token", "WxKeyword", "token");
//        $this->belongsTo("token", "WxAreply", "token");
    }

    public function notSave()
    {
        //Obtain the flash service from the DI container
        $flash = $this->getDI()->getFlash();

        //Show validation messages
        foreach ($this->getMessages() as $message) {
            $flash->error($message);
        }
    }

}